﻿using ctolua.Models.Class;
using ctolua.Models.Enum;

namespace ctolua.Models.UI.control
{
    public class MCModel : Mui
    {
        public override EUi type { get => EUi.模型; set => base.type = EUi.模型; }


        private int? _model_id;
        /// <summary>
        /// 模型id
        /// </summary>
        public int? model_id
        {
            get => _model_id;
            set
            {
                if (value != null)
                {
                    game_api.set_ui_model_id(this.role, this.id, value);
                }


                _model_id = value;
            }
        }

        private color? _color;
        /// <summary>
        /// 设置ui模型控件背景色
        /// </summary>
        public color? color
        {
            get => _color;
            set
            {
                if (value != null)
                {
                    game_api.set_show_room_background_color(this.role, this.id, value.r, value.g, value.b, value.a);
                }

                _color = value;
            }
        }

        private double? _fov;
        /// <summary>
        /// 设置观察模型视野范围
        /// </summary>
        public double? fov
        {
            get => _fov;
            set
            {
                if (value != null)
                {
                    game_api.change_showroom_fov(this.role, this.id, value);
                }

                _fov = value;
            }
        }


        private vec3? _pos;
        /// <summary>
        /// 设置观察模型镜头坐标
        /// </summary>
        public vec3? pos
        {
            get => _pos;
            set
            {
                if (value != null)
                {
                    game_api.change_showroom_cposition(this.role, this.id, value.x, value.y, value.z);
                }
                _pos = value;
            }
        }

        private vec3? _revolve;
        /// <summary>
        /// 设置观察模型镜头旋转
        /// </summary>
        public vec3? revolve
        {
            get => _revolve;
            set
            {
                if (value != null)
                {
                    game_api.change_showroom_crotation(this.role, this.id, value.x, value.y, value.z);
                }
                _revolve = value;
            }
        }

        private vec3? _focus_pos;
        /// <summary>
        /// 设置UI控件模型焦点
        /// </summary>
        public vec3? focus_pos
        {
            get => _focus_pos;
            set
            {
                if (value != null)
                {
                    game_api.set_ui_model_focus_pos(this.role, this.id, value.x, value.y, value.z);
                }
                _focus_pos = value;
            }
        }


        public MCModel()
        {
        }

        public MCModel(string id) : base(id)
        {
        }

        public MCModel(Mui u) : base(u)
        {
        }


    }
}
